home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / FPTMUL < prev    next >
Encoding:
Text File  |  1985-12-25  |  1.4 KB  |  48 lines

  1. ;-------------------------fptmul routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 85
  4. ;
  5. ; NAME FPTMUL
  6. ; ROUTINE FOR MULTPLICATION OF TEMPORARY FLOATING POINT NUMBER BY 10
  7. ;
  8. ; FUNCTION: This routine multiplies a temporary binary floating point
  9. ; number by 10.  The result is not normalized.
  10. ;
  11. ; INPUT: Upon entry DS:DI points to a temporary binary floating point
  12. ; number.
  13. ;
  14. ; OUTPUT: Upon exit DS:DI points to a temporary binary floating
  15. ; point number.  This number is not normalized.
  16. ;
  17. ; REGISTERS USED:  AX, CX, DX and DI are modified.  DI must point to
  18. ; the input.
  19. ;
  20. ; SEGMENTS REFERENCED:  The data segment must contain the temporary
  21. ; floating point number.
  22. ;
  23. ; ROUTINES CALLED:  None
  24. ; SPECIAL NOTES: This is a near procedure needed by FPIN.
  25. ;
  26. ; ROUTINE TO MULTIPLY TEMP FLOATING POINT NUMBER BY 10
  27. ;
  28. fptmul    proc    near
  29. ;
  30.     mov    cx,5        ; for a count of five
  31.     mov    dx,0        ; carry of zero
  32. ;
  33. fptmul1:
  34.     push    cx        ; save count
  35.     mov    ax,dx        ; previous carry
  36.     xchg    ax,[di]        ; switch with 16-bit digit
  37.     mov    cx,10        ; multiplier of 10
  38.     mul    cx        ; multiply
  39.     add    [di],ax        ; add into carry in place
  40.     add    di,2        ; next 16-bit digit
  41.     pop    cx        ; restore count
  42.     loop    fptmul1
  43. ;
  44.     ret            ; return
  45. ;    
  46. fptmul    endp
  47. ;-------------------------fptmul routine ends---------------------------+
  48.